#####################################################################################################################
# This script is used for a mediation analysis in "Politicians Appear More Competent When Using Numerical Rhetoric###
#####################################################################################################################

###Wd, Data and packages--------------------------------

#Home
setwd("C:/Numbers_as_competence")
exp4data <-read.csv("numbers_as_competence_for_R.csv", header=TRUE) 

#Replicating key result from STATA based analyses, as a check
  #STATA command: reg pro_higher_strength i.condition
  pro_higher_strength.out= lm(pro_higher_strength ~ condition, data=exp4data)
  pro_higher_strength.out
  summary(pro_higher_strength.out) #results are identical

install.packages("mediation") # this package is necessary to conduct the analyses
library(mediation,"C:/Numbers_as_competence")

install.packages("extrafont") #this package is just for getting the right font (no relevance for analyses)
library(extrafont,"C:/Numbers_as_competence")
  loadfonts()
  loadfonts(device="win")
  font_import()
#  Sys.setenv(R_GSCMD="C:/Program Files(x86)/gs/gs9.19/bin/gswin32c.exe")

#Seed used in all estimations:
set.seed(24092015) #this is done everytime an estimation is done


#############################################################################
# Analysis Assuming the Independence between the Mediators (Separate models for possible mediators)----
#############################################################################

#NOTE: Comparisons are not done in the same order as they appear in the paper!

### Strength (Competence) =========
model.ms <- lm(pro_higher_strength ~ condition +female2 + age + college2 + rightwing2 + interest2, data = exp4data)  
model.ys <- lm(voting_pro2 ~ condition + pro_higher_strength + female2 + age + college2 + rightwing2 + interest2, data = exp4data)

#Comparing conditions 2 and 3####
#Estimation of mediation
set.seed(24092015)
out.1 <- mediate(model.ms, model.ys, sims =1000, boot =TRUE, treat = "condition" , mediator = "pro_higher_strength", control.value = "3con_numbers", treat.value = "2pro_numbers" )
summary(out.1) #clear mediation through strength (competence)!
plot(out.1)
#Estimation of sensitivity
set.seed(24092015)
sens.out1 <- medsens(out.1, rho.by = 0.01, effect.type = "indirect", sims = 1000)
summary(sens.out1) #results are very robust, p=.63
  win.metafile('Competence, cond 2 and 3.wmf', family="Garamond", width=7, height =7, pointsize = 16)
  plot(sens.out1, sens.par = "rho", main ="Comparing Conditions 2 and 3", family="Garamond", ylim =c(-0.2, 0.2))
  dev.off()
  win.metafile('Competence, cond 2 and 3, positive.wmf', pointsize = 16)
  plot(sens.out1, sens.par = "R2",  main = "Conditions 2 and 3, positive product", r.type = "total" , sign.prod = "positive")
  dev.off()
  win.metafile('Competence, cond 2 and 3, negative.wmf', pointsize = 16)
  plot(sens.out1, sens.par = "R2", main = "Conditions 2 and 3, negative product 2 and 3", r.type = "total" , sign.prod = "negative")
  dev.off()
  
#Comparing conditions 2 and 1####
#Estimation of mediation
set.seed(24092015)
out.2 <- mediate(model.ms, model.ys, sims =1000, boot =TRUE, treat = "condition" , mediator = "pro_higher_strength", control.value = "1no_numbers", treat.value = "2pro_numbers" )
summary(out.2) #clear mediation through strength (competence)!
plot(out.2)
#Estimation of sensitivity
set.seed(24092015)
sens.out2 <- medsens(out.2, rho.by = 0.01, effect.type = "indirect", sims = 1000)
summary(sens.out2) #results are very robust, p=.63
win.metafile('Competence, cond 2 and 1.wmf', family="Garamond", pointsize = 16)
plot(sens.out2, sens.par = "rho", main = "Comparing Conditions 1 and 2", family="Garamond",ylim =c(-0.2, 0.2))
dev.off()
plot(sens.out2, sens.par = "R2", r.type = "total" , sign.prod = "positive")
plot(sens.out2, sens.par = "R2", r.type = "total" , sign.prod = "negative")

#Comparing conditions 3 and 1####
#Estimation of mediation
set.seed(24092015)
out.3 <- mediate(model.ms, model.ys, sims =1000, boot =TRUE, treat = "condition" , mediator = "pro_higher_strength", control.value = "1no_numbers", treat.value = "3con_numbers")
summary(out.3) #clear mediation through strength (competence)!
plot(out.3)
#Estimation of sensitivity
set.seed(24092015)
sens.out3 <- medsens(out.3, rho.by = 0.01, effect.type = "indirect", sims = 1000)
summary(sens.out3) #results are very robust, p=.63
win.metafile('Competence, cond 3 and 1.wmf', family="Garamond", pointsize = 16)
plot(sens.out3, sens.par = "rho", main = "Comparing Conditions 1 and 3", family="Garamond", ylim =c(-0.2, 0.2))
dev.off()
plot(sens.out3, sens.par = "R2", r.type = "total" , sign.prod = "positive")
plot(sens.out3, sens.par = "R2", r.type = "total" , sign.prod = "negative")

#Comparing conditions 2 and 4####
#Estimation of mediation
set.seed(24092015)
out.4 <- mediate(model.ms, model.ys, sims =1000, boot =TRUE, treat = "condition" , mediator = "pro_higher_strength", control.value = "4both_numbers", treat.value = "2pro_numbers" )
summary(out.4) #clear mediation through strength (competence)!
plot(out.4)
#Estimation of sensitivity
set.seed(24092015)
sens.out4 <- medsens(out.4, rho.by = 0.01, effect.type = "indirect", sims = 1000)
summary(sens.out4) #results are very robust, p=.63
win.metafile('Competence, cond 2 and 4.wmf', family="Garamond", pointsize = 16)
plot(sens.out4, sens.par = "rho", main = "Comparing Conditions 2 and 4", family="Garamond",ylim =c(-0.2, 0.2))
dev.off()
plot(sens.out4, sens.par = "R2", r.type = "total" , sign.prod = "positive")
plot(sens.out3, sens.par = "R2", r.type = "total" , sign.prod = "negative")

#Comparing conditions 3 and 4####
#Estimation of mediation
set.seed(24092015)
out.5 <- mediate(model.ms, model.ys, sims =1000, boot =TRUE, treat = "condition" , mediator = "pro_higher_strength", control.value = "4both_numbers", treat.value = "3con_numbers" )
summary(out.5) #almost significant mediation through strength (competence)!
plot(out.5)
#Estimation of sensitivity
set.seed(24092015)
sens.out5 <- medsens(out.5, rho.by = 0.01, effect.type = "indirect", sims = 1000)
summary(sens.out5)
win.metafile('Competence, cond 3 and 4.wmf', family="Garamond", pointsize = 16)
plot(sens.out5, sens.par = "rho", main = "Comparing Conditions 3 and 4", family="Garamond", ylim =c(-0.2, 0.2))
dev.off()
plot(sens.out5, sens.par = "R2", r.type = "total" , sign.prod = "positive")
plot(sens.out5, sens.par = "R2", r.type = "total" , sign.prod = "negative")

#Comparing conditions 1 and 4####
#Estimation of mediation
set.seed(24092015)
out.6 <- mediate(model.ms, model.ys, sims =1000, boot =TRUE, treat = "condition" , mediator = "pro_higher_strength", control.value = "1no_numbers", treat.value = "4both_numbers" )
summary(out.6) #
plot(out.6)
#Estimation of sensitivity
set.seed(24092015)
sens.out6 <- medsens(out.6, rho.by = 0.01, effect.type = "indirect", sims = 1000)
summary(sens.out6)
win.metafile('Competence, cond 1 and 4.wmf', family="Garamond", pointsize = 16)
plot(sens.out5, sens.par = "rho", main = "Comparing Conditions 1 and 4", family="Garamond", ylim =c(-0.2, 0.2))
dev.off()


### Warmth =========
model.mw <- lm(pro_higher_warmth ~ condition +female2 + age + college2 + rightwing2 + interest2, data = exp4data)  
model.yw <- lm(voting_pro2 ~ condition + pro_higher_warmth + female2 + age + college2 + rightwing2 + interest2, data = exp4data)

#Comparing conditions 2 and 3####
#Estimation of mediation
set.seed(24092015)
out.7 <- mediate(model.mw, model.yw, sims =1000, boot =TRUE, treat = "condition" , mediator = "pro_higher_warmth", control.value = "3con_numbers", treat.value = "2pro_numbers" )
summary(out.7) #
plot(out.7)
#Estimation of sensitivity
#set.seed(24092015)
#sens.out7 <- medsens(out.7, rho.by = 0.01, effect.type = "indirect", sims = 1000)
#summary(sens.out7) #
#plot(sens.out7, sens.par = "rho", main = "pro_higher_warmth", ylim =c(-0.2, 0.2))
#plot(sens.out7, sens.par = "R2", r.type = "total" , sign.prod = "positive")
#plot(sens.out7, sens.par = "R2", r.type = "total" , sign.prod = "negative")

#Comparing conditions 2 and 1####
#Estimation of mediation
set.seed(24092015)
out.8 <- mediate(model.mw, model.yw, sims =1000, boot =TRUE, treat = "condition" , mediator = "pro_higher_warmth", control.value = "1no_numbers", treat.value = "2pro_numbers" )
summary(out.8) #
plot(out.8)
#Estimation of sensitivity
#set.seed(24092015)
#sens.out8 <- medsens(out.8, rho.by = 0.01, effect.type = "indirect", sims = 1000)
#summary(sens.out8) #
#plot(sens.out8, sens.par = "rho", main = "pro_higher_warmth", ylim =c(-0.2, 0.2))
#plot(sens.out8, sens.par = "R2", r.type = "total" , sign.prod = "positive")
#plot(sens.out8, sens.par = "R2", r.type = "total" , sign.prod = "negative")

#Comparing conditions 3 and 1####
#Estimation of mediation
set.seed(24092015)
out.9 <- mediate(model.mw, model.yw, sims =1000, boot =TRUE, treat = "condition" , mediator = "pro_higher_warmth", control.value = "1no_numbers", treat.value = "3con_numbers" )
summary(out.9) #
plot(out.9)
#Estimation of sensitivity
#set.seed(24092015)
#sens.out9 <- medsens(out.9, rho.by = 0.01, effect.type = "indirect", sims = 1000)
#summary(sens.out9) #
#plot(sens.out3, sens.par = "rho", main = "pro_higher_warmth", ylim =c(-0.2, 0.2))
#plot(sens.out3, sens.par = "R2", r.type = "total" , sign.prod = "positive")
#plot(sens.out3, sens.par = "R2", r.type = "total" , sign.prod = "negative")

#Comparing conditions 2 and 4####
#Estimation of mediation
set.seed(24092015)
out.10 <- mediate(model.mw, model.yw, sims =1000, boot =TRUE, treat = "condition" , mediator = "pro_higher_warmth", control.value = "4both_numbers", treat.value = "2pro_numbers" )
summary(out.10) #
plot(out.10)
#Estimation of sensitivity
#set.seed(24092015)
#sens.out10 <- medsens(out.10, rho.by = 0.01, effect.type = "indirect", sims = 1000)
#summary(sens.out10) #results are very robust, p=.63
#plot(sens.out10, sens.par = "rho", main = "pro_higher_warmth", ylim =c(-0.2, 0.2))
#plot(sens.out10, sens.par = "R2", r.type = "total" , sign.prod = "positive")
#plot(sens.out10, sens.par = "R2", r.type = "total" , sign.prod = "negative")

#Comparing conditions 3 and 4####
#Estimation of mediation
set.seed(24092015)
out.11 <- mediate(model.mw, model.yw, sims =1000, boot =TRUE, treat = "condition" , mediator = "pro_higher_warmth", control.value = "4both_numbers", treat.value = "3con_numbers" )
summary(out.11) #
plot(out.11)
#Estimation of sensitivity
#set.seed(24092015)
#sens.out11 <- medsens(out.11, rho.by = 0.01, effect.type = "indirect", sims = 1000)
#summary(sens.out11) #
#plot(sens.out11, sens.par = "rho", main = "pro_higher_warmth", ylim =c(-0.2, 0.2))
#plot(sens.out11, sens.par = "R2", r.type = "total" , sign.prod = "positive")
#plot(sens.out11, sens.par = "R2", r.type = "total" , sign.prod = "negative")

#Comparing conditions 1 and 4####
#Estimation of mediation
set.seed(24092015)
out.12 <- mediate(model.mw, model.yw, sims =1000, boot =TRUE, treat = "condition" , mediator = "pro_higher_warmth", control.value = "1no_numbers", treat.value = "4both_numbers" )
summary(out.12) #
plot(out.12)
#Estimation of sensitivity
#set.seed(24092015)
#sens.out12 <- medsens(out.12, rho.by = 0.01, effect.type = "indirect", sims = 1000)   
#summary(sens.out12) #
#plot(sens.out12, sens.par = "rho", main = "pro_higher_warmth", ylim =c(-0.2, 0.2))
#plot(sens.out12, sens.par = "R2", r.type = "total" , sign.prod = "positive")
#plot(sens.out12, sens.par = "R2", r.type = "total" , sign.prod = "negative")

### GM_positive =========
model.mg <- lm(GM_positive2 ~ condition +female2 + age + college2 + rightwing2 + interest2, data = exp4data)  
model.yg <- lm(voting_pro2 ~ condition + GM_positive2 + female2 + age + college2 + rightwing2 + interest2, data = exp4data)

#Comparing conditions 2 and 3####
#Estimation of mediation
set.seed(24092015)
out.13 <- mediate(model.mg, model.yg, sims =1000, boot =TRUE, treat = "condition" , mediator = "GM_positive2", control.value = "3con_numbers", treat.value = "2pro_numbers" )
summary(out.13) #
plot(out.13)
#Estimation of sensitivity
#set.seed(24092015)
#sens.out13 <- medsens(out.13, rho.by = 0.01, effect.type = "indirect", sims = 1000)
#summary(sens.out13) #
#plot(sens.out13, sens.par = "rho", main = "GM_positive2", ylim =c(-0.2, 0.2))
#plot(sens.out13, sens.par = "R2", r.type = "total" , sign.prod = "positive")
#plot(sens.out13, sens.par = "R2", r.type = "total" , sign.prod = "negative")

#Comparing conditions 2 and 1####
#Estimation of mediation
set.seed(24092015)
out.14 <- mediate(model.mg, model.yg, sims =1000, boot =TRUE, treat = "condition" , mediator = "GM_positive2", control.value = "1no_numbers", treat.value = "2pro_numbers" )
summary(out.14) #
plot(out.14)
#Estimation of sensitivity
#set.seed(24092015)
#sens.out14 <- medsens(out.14, rho.by = 0.01, effect.type = "indirect", sims = 1000)
#summary(sens.out14) #
#plot(sens.out14, sens.par = "rho", main = "GM_positive2", ylim =c(-0.2, 0.2))
#plot(sens.out14, sens.par = "R2", r.type = "total" , sign.prod = "positive")
#plot(sens.out14, sens.par = "R2", r.type = "total" , sign.prod = "negative")

#Comparing conditions 3 and 1####
#Estimation of mediation
set.seed(24092015)
out.15 <- mediate(model.mg, model.yg, sims =1000, boot =TRUE, treat = "condition" , mediator = "GM_positive2", control.value = "1no_numbers", treat.value = "3con_numbers" )
summary(out.15) #
plot(out.15)
#Estimation of sensitivity
#set.seed(24092015)
#sens.out15 <- medsens(out.15, rho.by = 0.01, effect.type = "indirect", sims = 1000)
#summary(sens.out15) 
#plot(sens.out15, sens.par = "rho", main = "GM_positive2", ylim =c(-0.2, 0.2))
#plot(sens.out15, sens.par = "R2", r.type = "total" , sign.prod = "positive")
#plot(sens.out15, sens.par = "R2", r.type = "total" , sign.prod = "negative")

#Comparing conditions 2 and 4####
#Estimation of mediation
set.seed(24092015)
out.16 <- mediate(model.mg, model.yg, sims =1000, boot =TRUE, treat = "condition" , mediator = "GM_positive2", control.value = "4both_numbers", treat.value = "2pro_numbers" )
summary(out.16) #
plot(out.16)
#Estimation of sensitivity
#set.seed(24092015)
#sens.out16 <- medsens(out.16, rho.by = 0.01, effect.type = "indirect", sims = 1000)
#summary(sens.out16) #
#plot(sens.out16, sens.par = "rho", main = "GM_positive2", ylim =c(-0.2, 0.2))
#plot(sens.out16, sens.par = "R2", r.type = "total" , sign.prod = "positive")
#plot(sens.out16, sens.par = "R2", r.type = "total" , sign.prod = "negative")

#Comparing conditions 3 and 4####
#Estimation of mediation
set.seed(24092015)
out.17 <- mediate(model.mg, model.yg, sims =1000, boot =TRUE, treat = "condition" , mediator = "GM_positive2", control.value = "4both_numbers", treat.value = "3con_numbers" )
summary(out.17) #
plot(out.17)
#Estimation of sensitivity
#set.seed(24092015)
#sens.out17 <- medsens(out.17, rho.by = 0.01, effect.type = "indirect", sims = 1000)
#summary(sens.out17) #
#plot(sens.out17, sens.par = "rho", main = "GM_positive2", ylim =c(-0.2, 0.2))
#plot(sens.out17, sens.par = "R2", r.type = "total" , sign.prod = "positive")
#plot(sens.out17, sens.par = "R2", r.type = "total" , sign.prod = "negative")

#Comparing conditions 1 and 4####
#Estimation of mediation
set.seed(24092015)
out.18 <- mediate(model.mg, model.yg, sims =1000, boot =TRUE, treat = "condition" , mediator = "GM_positive2", control.value = "1no_numbers", treat.value = "4both_numbers" )
summary(out.18) #
plot(out.18)
#Estimation of sensitivity
#set.seed(24092015)
#sens.out18 <- medsens(out.18, rho.by = 0.01, effect.type = "indirect", sims = 1000)   
#summary(sens.out18) #
#plot(sens.out18, sens.par = "rho", main = "GM_positive2", ylim =c(-0.2, 0.2))
#plot(sens.out18, sens.par = "R2", r.type = "total" , sign.prod = "positive")
#plot(sens.out18, sens.par = "R2", r.type = "total" , sign.prod = "negative")

#############################################################################
# Analysis of moderated mediation----------
#############################################################################

model.mm <- lm(pro_higher_strength ~ condition * GM_attitude + female2 + age + college2 + rightwing2 + interest2, data = exp4data)  
model.my <- lm(voting_pro2 ~ condition * GM_attitude + pro_higher_strength * GM_attitude + female2 + age + college2 + rightwing2 + interest2, data = exp4data)
set.seed(24092015)
out.gm0 <- mediate(model.mm, model.my, sims =1000, boot =TRUE, treat = "condition" , mediator = "pro_higher_strength", covariates = list(GM_attitude = 0), control.value = "3con_numbers", treat.value = "2pro_numbers")
set.seed(24092015)
out.gm033 <- mediate(model.mm, model.my, sims =1000, boot =TRUE, treat = "condition" , mediator = "pro_higher_strength", covariates = list(GM_attitude = 0.33), control.value = "3con_numbers", treat.value = "2pro_numbers")
set.seed(24092015)
out.gm067 <- mediate(model.mm, model.my, sims =1000, boot =TRUE, treat = "condition" , mediator = "pro_higher_strength", covariates = list(GM_attitude = 0.67), control.value = "3con_numbers", treat.value = "2pro_numbers")
set.seed(24092015)
out.gm1 <- mediate(model.mm, model.my, sims =1000, boot =TRUE, treat = "condition" , mediator = "pro_higher_strength", covariates = list(GM_attitude = 1), control.value = "3con_numbers", treat.value = "2pro_numbers")
summary(out.gm0) 
summary(out.gm033)
summary(out.gm067)
summary(out.gm1) 
#stronger effect among R's without clear attitude on GM foods (but sig. for all groups at p=.1)
 
set.seed(24092015)
med.init <- mediate(model.mm, model.my, treat = "condition" , mediator = "pro_higher_strength", sims=2, control.value = "3con_numbers", treat.value = "2pro_numbers")
set.seed(24092015)
test.modmed(med.init, covariates.1 = list(GM_attitude=0), covariates.2 = list(GM_attitude=1), sims = 1000, control.value = "3con_numbers", treat.value = "2pro_numbers")
#difference is not significant    



#Aggregated plots-------------------------

#ACME###These plots are used for Figure 5 in the paper##########
win.metafile(filename="ACME_competence.emf", width=3, height =12, family="Garamond")
par(mar=c(2,4,4,0.5))
par(mfrow=c(6,1))
plot(out.2, xlim=c(-0.11, 0.11), main = "Comparing Conditions 1 and 2")
plot(out.3, xlim=c(-0.11, 0.11), main = "Comparing Conditions 1 and 3")
plot(out.6, xlim=c(-0.11, 0.11), main = "Comparing Conditions 1 and 4")
plot(out.1, xlim=c(-0.11, 0.11), main = "Comparing Conditions 2 and 3")
plot(out.4, xlim=c(-0.11, 0.11), main = "Comparing Conditions 2 and 4")
plot(out.5, xlim=c(-0.11, 0.11), main = "Comparing Conditions 3 and 4")
dev.off()

win.metafile(filename="ACME_warmth.emf", width=3, height =12, family="Garamond")
par(mar=c(2,4,4,0.5))
par(mfrow=c(6,1))
plot(out.8, xlim=c(-0.11, 0.11), main = "Comparing Conditions 1 and 2")
plot(out.9, xlim=c(-0.11, 0.11), main = "Comparing Conditions 1 and 3")
plot(out.12, xlim=c(-0.11, 0.11), main = "Comparing Conditions 1 and 4")
plot(out.7, xlim=c(-0.11, 0.11), main = "Comparing Conditions 2 and 3")
plot(out.10, xlim=c(-0.11, 0.11), main = "Comparing Conditions 2 and 4")
plot(out.11, xlim=c(-0.11, 0.11), main = "Comparing Conditions 3 and 4")
dev.off()

win.metafile(filename="ACME_gm.emf", width=3, height =12, family="Garamond")
par(mar=c(2,4,4,0.5))
par(mfrow=c(6,1))
plot(out.14, xlim=c(-0.11, 0.11), main = "Comparing Conditions 1 and 2")
plot(out.15, xlim=c(-0.11, 0.11), main = "Comparing Conditions 1 and 3")
plot(out.18, xlim=c(-0.11, 0.11), main = "Comparing Conditions 1 and 4")
plot(out.13, xlim=c(-0.11, 0.11), main = "Comparing Conditions 2 and 3")
plot(out.16, xlim=c(-0.11, 0.11), main = "Comparing Conditions 2 and 4")
plot(out.17, xlim=c(-0.11, 0.11), main = "Comparing Conditions 3 and 4")
dev.off()

#Sensitivity###These plots are used for Figure 6 in the paper (only "Competence," "Warmth" and "GM-attitudes" are omitted)##########
win.metafile(filename="sensitivity_competence.emf", width=12, height =16, family="Garamond")
par(mfrow=c(3,2))
plot(sens.out2, sens.par = "rho", main = "Comparing Conditions 1 and 2", ylim =c(-0.1, 0.1))
plot(sens.out3, sens.par = "rho", main = "Comparing Conditions 1 and 3", ylim =c(-0.1, 0.1))
plot(sens.out6, sens.par = "rho", main = "Comparing Conditions 1 and 4", ylim =c(-0.1, 0.1))
plot(sens.out1, sens.par = "rho", main = "Comparing Conditions 2 and 3", ylim =c(-0.1, 0.1))
plot(sens.out4, sens.par = "rho", main = "Comparing Conditions 2 and 4", ylim =c(-0.1, 0.1))
plot(sens.out5, sens.par = "rho", main = "Comparing Conditions 3 and 4", ylim =c(-0.1, 0.1))
dev.off()

win.metafile('Competence, cond 2 and 3.wmf', family="Garamond", pointsize = 16)
plot(sens.out1, sens.par = "rho", main = " ", family="Garamond", ylim =c(-0.2, 0.2))

#win.metafile(filename="sensitivity_warmth.emf", width=12, height =16)
#par(mfrow=c(3,2))
#plot(sens.out8, sens.par = "rho", main = "Comparing Conditions 1 and 2", ylim =c(-0.1, 0.1))
#plot(sens.out9, sens.par = "rho", main = "Comparing Conditions 1 and 3", ylim =c(-0.1, 0.1))
#plot(sens.out12, sens.par = "rho", main = "Comparing Conditions 1 and 4", ylim =c(-0.1, 0.1))
#plot(sens.out7, sens.par = "rho", main = "Comparing Conditions 2 and 3", ylim =c(-0.1, 0.1))
#plot(sens.out10, sens.par = "rho", main = "Comparing Conditions 2 and 4", ylim =c(-0.1, 0.1))
#plot(sens.out11, sens.par = "rho", main = "Comparing Conditions 3 and 4", ylim =c(-0.1, 0.1))
#dev.off()

#win.metafile(filename="sensitivity_gm.emf", width=12, height =16)
#par(mfrow=c(3,2))
#plot(sens.out14, sens.par = "rho", main = "Comparing Conditions 1 and 2", ylim =c(-0.1, 0.1))
#plot(sens.out15, sens.par = "rho", main = "Comparing Conditions 1 and 3", ylim =c(-0.1, 0.1))
#plot(sens.out18, sens.par = "rho", main = "Comparing Conditions 1 and 4", ylim =c(-0.1, 0.1))
#plot(sens.out13, sens.par = "rho", main = "Comparing Conditions 2 and 3", ylim =c(-0.1, 0.1))
#plot(sens.out16, sens.par = "rho", main = "Comparing Conditions 2 and 4", ylim =c(-0.1, 0.1))
#plot(sens.out17, sens.par = "rho", main = "Comparing Conditions 3 and 4", ylim =c(-0.1, 0.1))
#dev.off()
